import axios from 'axios';
import {commonParams} from './config.js';

export function getLrc (mid) {
  const api = 'api/getLrc';
  const para = Object.assign({}, commonParams, {
    songmid: mid,
    platform: 'yqq',
    hostUin: 0,
    needNewCode: 0,
    categoryId: 10000000,
    pcachetime: +new Date(),
    format: 'json'
  });

  return axios.get(api, {
    params: para
  }).then((res) => {
    return Promise.resolve(res.data);
  }).catch(() => {
    console.log('获取歌词失败 in api');
  });
}
